.ruler-container {
  position: relative;
  background-color: #f8f8f8;
  
  /* 刻度尺背景 - 填充整个容器 */
  .ruler-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #f8f8f8;
    z-index: 1;
  }
  
  /* 右侧背景延伸 */
  .ruler-h-extension {
    position: absolute;
    top: 0;
    height: 30px;
    width: 3000px; /* 延伸足够远 */
    background-color: #f0f0f0;
    border-bottom: 1px solid #ccc;
    z-index: 9;
  }
  
  /* 刻度尺左上角交叉点 */
  .ruler-corner {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    z-index: 15;
  }
  
  /* 水平刻度尺 */
  .ruler-horizontal {
    position: absolute;
    top: 0;
    left: 30px;
    height: 30px;
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    right: 0;
    overflow: visible;
    z-index: 10;
    
    .ruler-mark {
      position: absolute;
      width: 1px;
      height: 5px;
      background-color: #666;
      bottom: 0;
      
      &.cm-mark {
        height: 10px;
        background-color: #333;
      }
      
      &.half-cm-mark {
        height: 7px;
        background-color: #555;
      }
      
      .ruler-number {
        position: absolute;
        bottom: 12px;
        left: 0;
        transform: translateX(-50%);
        font-size: 10px;
        color: #333;
      }
    }
  }
  
  /* 垂直刻度尺 */
  .ruler-vertical {
    position: absolute;
    top: 30px;
    left: 0;
    width: 30px;
    background: #f0f0f0;
    border-right: 1px solid #ccc;
    overflow: visible;
    z-index: 10;
    
    .ruler-mark {
      position: absolute;
      height: 1px;
      width: 5px;
      background-color: #666;
      right: 0;
      
      &.cm-mark {
        width: 10px;
        background-color: #333;
      }
      
      &.half-cm-mark {
        width: 7px;
        background-color: #555;
      }
      
      .ruler-number {
        position: absolute;
        right: 12px;
        top: -7px;
        font-size: 10px;
        color: #333;
      }
    }
  }
  
  /* 底部背景填充 */
  .ruler-v-extension {
    position: absolute;
    left: 0;
    width: 30px;
    height: 3000px; /* 延伸足够远 */
    background-color: #f0f0f0;
    border-right: 1px solid #ccc;
    z-index: 9;
  }
  
  /* 画布容器 */
  .canvas-container {
    position: absolute;
    top: 30px;
    left: 30px;
    background: white;
    z-index: 5;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    outline: 1px solid #e4e7ed;
  }
}

/* 画布背景扩展区域 */
.canvas-background {
  position: absolute;
  top: 30px;
  left: 30px;
  right: 0;
  bottom: 0;
  background-color: #f8f8f8;
  z-index: 2;
}

.ruler-controls {
  position: absolute;
  right: 15px;
  top: 15px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 12px;
  width: 100px;
  border-radius: 10px;
  box-shadow: 0 3px 15px 0 rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(235, 238, 245, 0.9);
  
  .ruler-title {
    font-size: 12px;
    color: #606266;
    margin-bottom: 5px;
    font-weight: bold;
    text-align: center;
    width: 100%;
  }
  
  .ruler-scale {
    font-size: 12px;
    color: #909399;
    margin-top: 5px;
    text-align: center;
    background-color: #f5f7fa;
    padding: 3px 8px;
    border-radius: 4px;
    width: 80%;
    transition: all 0.3s;
    
    &.scale-changed {
      color: #409eff;
      background-color: #ecf5ff;
      transform: scale(1.1);
      font-weight: bold;
    }
  }
} 